package pl.mdziedzic.unittests.selenium;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.ExpectedCondition;

public class ElementPresentCondition implements ExpectedCondition<WebElement> {

	private final By by;

	public ElementPresentCondition(By by) {
		this.by = by;
	}

	@Override
	public WebElement apply(WebDriver driver) {
		return driver.findElement(by);
	}

}
